//
//  OEHaoItWorkTableViewCell.m
//  OneEightyNine
//
//  Created by Mac on 2019/3/5.
//  Copyright © 2019 stoneobs. All rights reserved.
//

#import "OEHaoItWorkTableViewCell.h"

@interface  OEHaoItWorkTableViewCell()
@property(nonatomic, strong) STLabel                     *titleLable;/**<  */
@property(nonatomic, strong) STLabel                     *subtitleLable;/**<  */
@end
@implementation OEHaoItWorkTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 50;
}
#pragma mark --subView
- (void)configSubView{
    self.clipsToBounds = YES;
    
    self.titleLable = [[STLabel alloc] initWithFrame:CGRectMake(10, 0, UIScreenWidth - 20, self.class.cellHeight)
                                                     text:@""
                                                textColor:FirstTextColor
                                                     font:17
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.titleLable];
    [self.titleLable st_showBottomLine];
    
    self.subtitleLable = [[STLabel alloc] initWithFrame:CGRectMake(10, self.class.cellHeight, UIScreenWidth - 20, self.class.cellHeight)
                                                text:@""
                                           textColor:SecendTextColor
                                                font:14
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.subtitleLable];

    
    self.openButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)
                                                     title:nil
                                                titleColor:nil
                                                 titleFont:0
                                              cornerRadius:0
                                           backgroundColor:nil
                                           backgroundImage:nil
                                                     image:[UIImage imageNamed:@"18×10功能加上下拉"]];
    [self.openButton setImage:[UIImage imageNamed:@"18×10功能介绍上拉"] forState:UIControlStateSelected];
    self.openButton.centerY = self.titleLable.centerY;
    self.openButton.right = UIScreenWidth - 10;
    self.openButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    [self addSubview:self.openButton];
}
- (void)setModel:(STTableEasyModel *)model{
    _model = model;
    self.openButton.selected = model.isSlected;
    self.titleLable.text = model.textString;
    self.subtitleLable.text = model.detailString;
    [NSString lableAutoAdjustheightWithLabel:self.subtitleLable];
    model.height = self.subtitleLable.bottom + 10;
}
@end
